<template>
  <div>
    <input type="text" v-model="uname">
    <button @click="handleLogin">登录</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      uname: ''
    }
  },
  methods: {
    handleLogin() {
      // console.log(this.uname)
      localStorage.setItem('utoken', this.uname)
      this.$router.replace({
        name: 'home'
      })
    }
  },
  // beforeRouteEnter
}
</script>

<style scoped>

</style>